package com.yssystem.controller;



import com.yssystem.domain.SysUser;
import com.yssystem.service.SysUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/user")
@CrossOrigin
public class UserController {
    @Autowired
    private SysUserService sysUserService;
    @GetMapping
    public List<SysUser> getUserList(@RequestParam String keyName, String postValue,String roleValue){
        List<SysUser> getuserlist=sysUserService.getUserList(keyName,postValue,roleValue);

        return getuserlist;
    }
    @PutMapping("/{status}/{id}")
    public Boolean updateStatus(@PathVariable Integer status,@PathVariable Integer id){
        Boolean aBoolean = sysUserService.updateStatus(status, id);
        return aBoolean;
    }
    @DeleteMapping("/{id}")
    public Boolean delUser(@PathVariable Integer id){

        Boolean aBoolean = sysUserService.delUser(id);
        return aBoolean;
    }


}
